/*
 * @Author: your name
 * @Date: 2021-01-29 15:08:34
 * @LastEditTime: 2021-02-04 11:07:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \wechat-node\routes\news.js
 */
const router = require('koa-router')();
const {ForumsModel} = require('../model/forum');

// 获取帖子
router.get('/forum/list', async (ctx, next) => {
    await ForumsModel.getForums(ctx);
});
router.post('/forum/comment', async (ctx, next) => {
    await ForumsModel.comment(ctx);
});
router.get('/forum/comment', async (ctx, next) => {
    await ForumsModel.getComment(ctx);
});
// 增加帖子
router.post('/add/forum', async (ctx, next) => {
    await ForumsModel.addForum(ctx);
});
// 删除帖子
router.post('/delete/forum', async (ctx, next) => {
    await ForumsModel.deleteForum(ctx);
});
module.exports = router;